﻿using System;
using System.Windows.Forms;
using Hearthstone_Deck_Tracker;

namespace AllanPlugins
{
    public partial class DuowanImportForm : Form
    {
        public DuowanImportForm()
        {
            InitializeComponent();
        }

        private void importBtn_Click(object sender, EventArgs e)
        {
            string importstr = convert();
            import(importstr);
        }

        private void import(string importstr) {
            var deck = Helper.ParseCardString(importstr, false); //默认false
            Core.MainWindow.SetNewDeck(deck);
        }

        private string convert() {
            DuowanConverter converter = new DuowanConverter();
            string[] converted = converter.getConvertedToEngNames(textBox.Text);
            converter.release();
            showInfoLab.Text = converted[1];
            return converted[0];
        }

    }
}
